package com.example.demo.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;
import java.util.Objects;

@Data
@TableName("t_parameter_attribute")
public class ParameterAttributeValueEntity {
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    @TableField("attributeName")
    private String attributeName;

    @TableField("parentId")
    private Long parentId;

    @TableField("intValue")
    private Integer intValue;

    @TableField("stringValue")
    private String stringValue;

    @TableField("longValue")
    private Long longValue;

    @TableField("datetimeValue")
    private Date datetimeValue;

    @TableField("datetimeValue2")
    private Date datetimeValue2;

    @TableField("booleanValue")
    private Short booleanValue;

    @TableField("attributeCode")
    private String attributeCode;

    @TableField("dataType")
    private String dataType;

    @TableField("removed")
    private Short removed;

    @TableField("currVersion")
    private Integer currVersion;

    @TableField("parameterRootId")
    private Long parameterRootId;

    @TableField("doubleValue")
    private Long doubleValue;

    @TableField("createDate")
    private Date createDate;

    @TableField("updateDate")
    private Date updateDate;

    @TableField("textValue")
    private String textValue;



    public boolean compare(ParameterAttributeValueEntity that) {
        return Objects.equals(attributeName, that.attributeName) && Objects.equals(parentId, that.parentId) && Objects.equals(intValue, that.intValue) && Objects.equals(stringValue, that.stringValue) && Objects.equals(longValue, that.longValue) && Objects.equals(datetimeValue, that.datetimeValue) && Objects.equals(datetimeValue2, that.datetimeValue2) && Objects.equals(booleanValue, that.booleanValue) && Objects.equals(attributeCode, that.attributeCode) && Objects.equals(dataType, that.dataType) && Objects.equals(removed, that.removed) && Objects.equals(currVersion, that.currVersion) && Objects.equals(parameterRootId, that.parameterRootId) && Objects.equals(doubleValue, that.doubleValue)  && Objects.equals(textValue, that.textValue);
    }
}